﻿@using SmartCode
@using SmartCode.CLI
@using RazorLight

@inherits TemplatePage<BuildContext>
@{
    DisableEncoding = true;
    var project = Model.Project;
    var buildTask = Model.Build;
    var table = Model.GetCurrentTable();
}
@{ await IncludeAsync("Copyright.cshtml", Model); }

using System;
namespace @(project.Module).@buildTask.Module
{
    @("///<summary>")
    @($"///{table.Description ?? table.ConvertedName}")
    @("///</summary>")
    public class @table.ConvertedName
    {
        @foreach (var column in table.Columns)
        {
            @(this.PadLeft(8)+"///<summary>\r\n")
            @(this.PadLeft(8)+$"///{column.Description ?? column.ConvertedName}\r\n")
            @(this.PadLeft(8)+"///</summary>\r\n")
            @this.PadLeft(8)<text>public</text> <text>@column.LanguageType</text><text>@(column.IsNullable&&column.LanguageType.ToLower()!="string" ? "?" : "")</text> <text>@column.ConvertedName</text> <text>{ get; set; }</text>@("\r\n")
        }
    }
}
